<%@ page import="cdu.javaendwork.model.sqlModel.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../static/bootstrap-5.1.3-dist/css/bootstrap.css">
    <script type="text/javascript" src="../static/bootstrap-5.1.3-dist/js/bootstrap.js"></script>
    <title>个人资料修改</title>
</head>
<style>
    .back{
        position: absolute;
        font-size: 26px;
        top:30px;
        left:40px;
        text-decoration: none;
        color: #000;
        font-weight: bold;
    }
    .back:hover{
        color: #000;
    }

    .card{
        width: 1400px;
        height: 700px;
        background-color: #fffdfd;
        border-radius: 30px;
        border: none;
        box-shadow: 5px 5px 10px #adabab;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
    }

    .mod{
        padding: 10px 300px;
    }
    .mb-3{
        padding-bottom: 30px;
    }
    .btn button:nth-child(1){
        margin-right: 40px;
    }
</style>
<body>

<%
    User user= (User) request.getAttribute("user");
%>

<a href="${pageContext.request.contextPath}/post_list" class="back">
    <span><</span>返回</a>
<div class="card">
    <form action="user_mod" method="post" enctype="multipart/form-data" class="mod">
        <input type="text" name="userid" value="<%=user.getId()%>" style="display: none"><br>
        <div class="form-floating mb-3">
            <input type="text" class="form-control" name="username" id="floatingName" placeholder="姓名" value="<%=user.getUsername()%>">
            <label for="floatingName">用户姓名</label>
        </div>
        <div class="form-floating mb-3">
            <input class="form-control" type="password" name="password" id="floatingPassword" placeholder="密码" autocomplete="off" value="<%=user.getPassword()%>">
            <label for="floatingPassword">密码</label>
        </div>
        <div class="form-floating mb-3">
            <input class="form-control" type="text" name="phone" id="floatingPhone" placeholder="手机号" autocomplete="off" value="<%=user.getPhone()%>">
            <label for="floatingPhone">电话号码</label>
        </div>
        <div class="form-floating mb-3">
            <input class="form-control" type="text" name="userprofile" id="floatingProfile" placeholder="用户简介" autocomplete="off" value="<%=user.getUserprofile()%>">
            <label for="floatingProfile">个人简介</label>
        </div>
        <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">头像</label>
            <div class="col-sm-10">
                <input class="form-control" value="<%=user.getPhoto()%>" disabled >
            </div>
        </div>
        <div class="mb-3 row">
            <label class="col-sm-2 col-form-label">修改头像</label>
            <div class="col-sm-10">
                <input class="form-control" type="file" name="photo">
            </div>
        </div>
        <div class="mb-3 row">
            <div class="btn">
                <button type="submit" class="btn btn-outline-success btn-lg">修 改</button>&nbsp;&nbsp;&nbsp;
                <button type="reset" class="btn btn-outline-dark btn-lg">重 置</button>
            </div>
        </div>
        <%--        管理员姓名：--%>
        <%--        <input type="text" name="username" value="<%=user.getUsername()%>"><br>--%>
        <%--        密码：--%>
        <%--        <input type="text" name="password" value="<%=user.getPassword()%>"><br>--%>
        <%--        电话：--%>
        <%--        <input type="phone" name="phone" value="<%=user.getPhone()%>"><br>--%>
        <%--        个人描述：--%>
        <%--        <input type="userprofile" name="userprofile" value="<%=user.getUserprofile()%>"><br>--%>
        <%--        头像：--%>
        <%--        <input  value="<%=user.getPhoto()%>" disabled><br>--%>

        <%--        修改头像<br>--%>
        <%--        <input type="file" name="photo">--%>
        <%--        <input type="submit" value="修 改">--%>
        <%--        <input type="reset" value="重 置">--%>
    </form>
</div>

</body>
</html>
